Ansible Script to standardise access via SSH
├── edit.yml
├── inventory
│ └── hosts.yml
└── ssh_public_key.pub
The Ansible playbook is designed to standardize access via SSH by adding public keys to the teleicu-middleware instances.
hosts.yml contains the list of hostnames of all the instances.
edit.yml connects to all the hosts specified in hosts.yml
and checks if the specified key is listed in the .ssh/authorized_keys
file. If not, it adds the given public key, thereby granting access.
ssh_public_key.pub is the public key pair for which we are granting access.
How To
- Clone the repository Middleware-Ansible and cd into it.
- Create a python venv by running
python -m venv ansible
- Install ansible by running
pip install -r requirements.txt
- Run the playbook by
ansible-playbook -i inventory/hosts.yml edit.yml -u username